<template>
<div class="serving-merchandise-add views-container">
  <div class="wlm-form">
    <div class="wlm-form-header">{{`${isFormEdit?'编辑':'添加'}商品参数`}}</div>
    <div class="wlm-form-content">
      <el-form :ref="formFormatData.key" :model="formFormatData.formData" :rules="formFormatData.rules" 
      size="small" label-width="120px" class="retail-form" label-position="right">
        <el-form-item label="服务名称" prop="username">
          <el-input v-model.trim="formFormatData.formData.title">
          </el-input>
        </el-form-item>
        <el-form-item label="服务内容" prop="username">
          <el-input :autosize="{ minRows: 4, maxRows: 4}" type="textarea"  v-model.trim="formFormatData.formData.content">
          </el-input>
        </el-form-item>
      </el-form>
    </div>
  </div>
  <div v-cloak class="wlm-fixed-btn flex-row flex-align-c flex-justify-c">
    <el-button size="small" @click="formFormatSubmit({ router: { type: 'replace', path: '/merchandise/servingMerchandise', code: 1 }})" type="primary">保存</el-button>
    <router-link tag="span" to="/merchandise/servingMerchandise">
      <el-button size="small">返回</el-button>
    </router-link>
  </div>
</div>
</template>

<script>
import {
  serviceGet,
  serviceEdit
} from '@/api/merchandise'
import mixins from '@/mixins/mixins'
export default {
  mixins: [mixins.getters('Form')],
  name: 'ManagementUserAdd',
  components: {

  },
  directives: {

  },
  data() {
    return {
      formFormatData: {
        key: 'userForm',
        api: {
          editForm: {
            api: serviceGet,
            params: {
              id: ''
            }
          },
          submitForm: serviceEdit
        },
        formData: {
          title: '',
          content: ''
        },
        rules: {
          // nickname: [{
          //   required: true,
          //   message: '请输入真实姓名',
          //   trigger: 'blur'
          // }],
          // username: [{
          //   required: true,
          //   message: '请输入用户手机号',
          //   trigger: 'blur'
          // },
          // {
          //   validator: mobile,
          //   trigger: 'blur'
          // }
          // ]
        }
      }
    }
  },
  methods: {

  }
}
</script>

<style lang="scss" scoped>
.serving-merchandise-add {}
</style>
